<portlet return="array" return_var="frags"  cache="60" 
  			 limit="30" showpages="0"  recursive="-1"  conditions="deleted[]=0" 
			 model="Frag" order="RAND()"></portlet><!-- conditions="cate_id[]=105&cate_id[]=106"  -->
			 
<?php 
$frags =  $frags['datalist'];
$frag_index = 0;
?>

			<div class="ui-portlet clearfix ">
			<ul  class="editor-template-list ui-portlet-list">
			{{loop $stylelist $item_all}}
				<?php $item=$item_all['EditorStyle']; ?>
			<li id="style-{{$item['id']}}" data-click="{{$item_all['Favorite']['click_nums']}}" data-time="{{strtotime($item_all['Favorite']['updated'])}}" {{if $item['rules']}}data-rules="{{$item['rules']}}"{{/if}} 
{{if $item['summary']}} data-content="{{str_replace('"','',$item['summary'])}}" data-title="ID:{{$item['id']}},{{$item['name']}}" data-trigger="hover" data-placement="right" data-container="body" data-toggle="popover"{{else}} data-placement="right"  data-container="body" data-toggle="tooltip" title="ID:{{$item['id']}},{{$item['name']}},{{$item_all['Favorite']['name']}}" {{/if}}
class="style-item {{if $item['brush_image']}}brush-image{{/if}} {{if $item['cate_id'] > 49}} cate-{{$item['cate_id']}} {{/if}} {{loop $item_all['Tag'] $tag}}  tagtpl-{{$tag['id']}} {{/loop}}" data-id="{{$item['id']}}">
				
				{{if $item['brush_image']}}
					<img data-id="{{$item['id']}}" data-role="brush-img" title="{{$item['name']}}" data-src="{{$item['coverimg']}}" />
				{{elseif $item['cate_id'] > 49}}
					<section class="_135editor" data-tools="135编辑器" data-id="{{$item['id']}}"><section style="text-align:center;"><section style="display:inline-block;{{if $item['cover_width']}}width:{{$item['cover_width']}}px;{{/if}}"><img data-id="{{$item['id']}}" data-role="guide-img" style="max-width:100%;{{if $item['cover_width']}}width:{{$item['cover_width']}}px;{{/if}}" title="{{$item['name']}}" data-src="{{$item['coverimg']}}" /></section></section></section>
				{{else}}
					<?php if($key > 10) {$content = lazyloadimg($item['content']);} else{ $content = $item['content']; } $content =  parseFragContent($content,$frags[$frag_index],$frag_index);  ?>
					<section class="_135editor" data-tools="135编辑器" data-id="{{$item['id']}}">{{$content}}</section>
				{{/if}}
						<div style="position:absolute;bottom:0px;right:0px;width:150px;text-align:right;">
							{{if !empty($_SESSION['Auth']['Staff']) }}
						    		<a class="btn btn-xs" style="color:rgb(255, 129, 36);font-size:20px;" href="{{Router::url('/admin/editor_styles/edit/'.$item['id'])}}" target="_blank">
						    		<i class="fa fa-edit"></i>
						    		</a>
						    {{/if}}
						    
						    
						    {{if !empty($item_all['Favorite'])}}
						    
						    <a class="btn btn-xs" style="color:rgb(255, 129, 36);font-size:20px;" onclick="publishController.open_dialog('/favorites/edit/{{$item_all['Favorite']['id']}}',{title:'编辑收藏样式别名，用于搜索。'});" href="javascript:void(0)" target="_blank">
				    			<i class="fa fa-edit" data-toggle="tooltip" data-container="body" data-placement="top" title="编辑收藏样式别名，用于搜索。" ></i>
				    		</a>
				    		
							<a class="btn btn-xs" style="color:rgb(255, 129, 36);font-size:20px;" href="javascript:;" data-url="{{$this->Html->url('/favorites/refresh/'.$item_all['Favorite']['id'])}}" onclick="return refreshfavorite(this);">
								<i class="fa fa-arrow-up" data-toggle="tooltip" data-container="body" data-placement="top" title="刷新收藏时间，移到顶部" ></i>
							</a> 
							<a class="btn btn-favorite btn-xs" style="color:rgb(255, 129, 36);font-size:20px;" href="javascript:;" data-model="EditorStyle" data-id="{{$item['id']}}">
								<i class="fa fa-trash" data-toggle="tooltip" data-container="body" data-placement="top" title="{{__('Cancel Favorite')}}"></i>
							</a>
							<span class="btn btn-xs"  style="color:rgb(255, 129, 36);">使用<strong>{{$item_all['Favorite']['click_nums']}}</strong>次</span>
							{{else}}
							<a class="btn btn-favorite btn-xs" style="color:rgb(255, 129, 36);font-size:20px;" href="javascript:;" data-model="EditorStyle" data-id="{{$item['id']}}">
								<i class="fa fa-heart-o"  data-toggle="tooltip" data-container="body" data-placement="top" title="{{__('Favorite')}}" ></i>
							</a>
							{{/if}}
							
						</div>
					</li>
			{{/loop}}
		</ul>
		</div>

		<div id="load-more-style" class="alert alert-warning m0">
{{if (!empty($CurrentUser) && $current_user_id)}}
			<p>前往<a href="http://www.135editor.com/style-center?cate_id=1">样式中心</a>收藏其它新样式</p>	
{{else}}
			<p>注册登录后前往样式中心，可收藏显示更多样式，定制个人专属的样式操作列表。<a  href="{{$this->Html->url('/users/login')}}?referer=/style-center?cate_id=1" target="_blank">立即登录</a></p>
{{/if}}
		</div>